﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Media;
using System.Xml.Linq;

namespace vmlModel.Entities
{
   public  class vmlShadow : vmlObject
    {
       public Color Color { get { return (vmlObjElement.Attribute("color") != null) ? vmlUtils.StringToColor(vmlObjElement.Attribute("color").Value.Split(char.Parse(" "))[0]) : Colors.Gray; } }
       public Color Color2 { get { return (vmlObjElement.Attribute("color2") != null) ? vmlUtils.StringToColor(vmlObjElement.Attribute("color2").Value.Split(char.Parse(" "))[0]) : Colors.Gray; } }
       public double Opacity { get { return (vmlObjElement.Attribute("opacity") != null) ? double.Parse(vmlObjElement.Attribute("opacity").Value.Replace("f","")) : 1; } }
       public double ShadowDepth
       {
           get
           {
               if (vmlObjElement.Attribute("offset") != null)
               {
                   string atrrValue = vmlObjElement.Attribute("offset").Value;
                   return vmlUtils.GetHypotenuseLength(atrrValue);
               }
               return 1;
           }
       }
       public vmlShadow()
       {

       }
       public vmlShadow(XElement _vmlObjElement)
           : base(_vmlObjElement)
       {
           FillMe();
       }

       private void FillMe()
       {
           
       }

    }
}
